/*
* @author dumeng
*/
'use strict'

import request from '@/utils/request'

export function getConfigByName(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sys/sysConfig/getByName',
    method: 'POST',
    data
  })
}
/**
 * 惠福专区列表
 * @param data
 * @returns {*}
 */
export function queryPageByArea(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/exchangeActivity/prefecture',
    method: 'post',
    data
  })
}

export function queryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/giveInfo/queryPage',
    method: 'post',
    data
  })
}
/**
 * 删除
 * @param {*} id
 */
export function del(ids) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/giveInfo/deleteByIds',
    method: 'get',
    params: { ids }
  })
}

/**
 * 查询详情全部
 * @param {*} id
 */
export function getView(id) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/giveInfo/getView',
    method: 'get',
    params: { id }
  })
}

/**
 * 修改状态
 * @param {*} data
 */
export function updatePublishStatus(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/giveInfo/updateWelfareStatus',
    method: 'post',
    data
  })
}

/**
 * 发布并发放给人员
 * @param {*} data
 */
export function updatePublish(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/giveInfo/publish',
    method: 'post',
    data
  })
}

/**
 * 获取是否需要选择出金账户
 * @param {*} data
 * @returns
 */
export function getIsAcc(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sys/sysConfig/getByName',
    method: 'post',
    data
  })
}
/**
 * 获取出金账户
 * @param {*} data
 * @returns
 */
export function getAcc(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/account/getExpenditureAccount',
    method: 'post',
    data
  })
}
/**
 * 获取充值记录
 * @param {*} data
 * @returns
 */
export function getRech(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/recharge/getRechargeWelfare',
    method: 'post',
    data
  })
}
/**
 * 获取京东充值记录
 * @param {*} data
 * @returns
 */
export function getJdRech(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/recharge/getRechargeJD',
    method: 'post',
    data
  })
}

/**
 * 职工福利子账户
 * @param {*} data
 * @returns
 */
export function queryAccount(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/childAccount/queryItemList',
    method: 'post',
    data
  })
}
/**
 * 获取京东活动
 * @param {*} data
 * @returns
 */
export function queryJd(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/jdActivity/query',
    method: 'post',
    data
  })
}
/**
 * 获取兑换券券列表
 * @param data
 */
export function queryCoupons(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/exchangeCoupon/query',
    method: 'post',
    data
  })
}

/*
 获取商城商户白名单信息
*/
export function queryMerchant(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/merchantInfo/query',
    method: 'post',
    data
  })
}
/*
	获取商城线下提货券
*/
export function merchantCoupons(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/merchantInfo/queryMchntCouponListPage',
    method: 'post',
    data
  })
}
/**
 * 添加福利包
 * @param {*} data
 */
export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/giveInfo/insertWelfareActivity',
    method: 'post',
    data
  })
}
/**
 * 查询详情
 * @param {*} id
 */
export function get(id) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/giveInfo/getWelfareActivity',
    method: 'get',
    params: { id }
  })
}

/**
 * 发放福利
 * @param {*} data
 */
export function grant(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/giveInfoDetail/updatesStatus',
    method: 'post',
    data
  })
}
/**
 * 编辑
 * @param {*} data
 */
export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/giveInfo/updateWelfareActivity',
    method: 'post',
    data
  })
}
/**
 * 获取一条充值记录
 * @param {*} data
 */
export function getRechOne(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/recharge/getOneList',
    method: 'post',
    data
  })
}

/**
 * 添加专区
 * @param {*} data
 */
export function createArea(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/welfareArea/insert',
    method: 'post',
    data
  })
}
/**
 * 编辑专区
 * @param {*} data
 */
export function updateArea(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/welfareArea/update',
    method: 'post',
    data
  })
}
/**
 * 人数及金额详情
 * @param {*} data
 */
export function getWelfareActivityView(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/giveInfo/getWelfareActivityView',
    method: 'post',
    data
  })
}
/**
 * 查询当前提醒的信息
 * @param {*} data
 */
export function giveUseDetail(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/giveInfo/giveUseDetail',
    method: 'post',
    data
  })
}
/**
 * 发送短信提示
 * @param {*} data
 */
export function sendSms(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/giveInfo/sendSms',
    method: 'post',
    data
  })
}
